from bilibili_api import video, sync, Credential

v = video.Video(bvid='BV1P94y1B7kp')#视频BV号

dms = sync(v.get_danmakus(0))

for dm in dms:
    print(dm)